function systemTime() {
    let d = new Date();
    let year = d.getFullYear()
    let month = d.getMonth() + 1
    let day = d.getDate()
    let hours = d.getHours()
    let min = d.getMinutes()
    let sec = d.getSeconds()
    let str = `${year}年${month}月${day}日${hours}时${min}分${sec}秒`
    document.getElementById("center").innerHTML = str
    setInterval(() => {
        let d = new Date();
        let year = d.getFullYear()
        let month = d.getMonth() + 1
        let day = d.getDate()
        let hours = d.getHours()
        let min = d.getMinutes()
        let sec = d.getSeconds()
        let str = `${year}年${month}月${day}日${hours}时${min}分${sec}秒`
        document.getElementById("center").innerHTML = str
    }, 1000)
}
systemTime();

function loginName() {
    let userInfo = sessionStorage.getItem("userInfo")
    let urseObj = JSON.parse(userInfo)
    let manageName = document.querySelector("#manageName")
    manageName.innerHTML = urseObj.name;
}
loginName();

let quit = document.querySelector("#quit")
quit.onclick = function () {
    let a = confirm("确定退出吗？")
    if (a) {
        sessionStorage.removeItem("login")
        location.href = "../html/login.html"
    }
}
let logout = document.querySelector("#logout")
logout.onclick = function () {
    let a = confirm("确定退出吗？")
    if (a) {
        sessionStorage.removeItem("login")
        location.href = "../html/login.html"
    }
}